package com.lambda;

import com.bean.Dog;

import java.util.function.Supplier;

/**
 * @ProjectName: Lambda
 * @Package: com.lambda
 * @ClassName: Cat
 * @Author: LXC
 * @Description: 猫
 * @Date: 2025/4/14 15:24
 */
public class Cat {

    public Cat() {
        System.out.println("Dog created!");
    }

    public static void main(String[] args) {
        Supplier<Cat> supplier1 = Cat::new;
        Supplier<Cat> supplier2 = () -> new Cat();

        Cat d1 = supplier1.get();  // 输出: Dog created!
        Cat d2 = supplier2.get();  // 输出: Dog created!
    }
}
